package com.mac.pojo;

import java.sql.Timestamp;

/**
 * 创建用户表 Users 实体类
 * 包含用户的基本信息和角色
 */
public class User {

    // 用户唯一标识，自增主键
    private  Integer userId;

    // 用户名，不能为空
    private String username;

    // 密码（加密存储），不能为空
    private String password;

    // 性别
    private String gender;
    // 手机号（加密存储），不能为空
    private String telephone;

    // 用户邮箱，不能为空
    private String email;

    // 用户角色，不能为空
    private String role;

    // 账户创建时间，默认为当前时间
    private Timestamp createdAt;

    // 账户最后更新时间，默认为当前时间，更新时自动更新
    private Timestamp updateAt;

    public User() {
    }

    public User(Integer userId, String username, String password, String gender, String telephone, String email, String role, Timestamp createdAt, Timestamp updateAt) {
        this.userId = userId;
        this.username = username;
        this.password = password;
        this.gender = gender;
        this.telephone = telephone;
        this.email = email;
        this.role = role;
        this.createdAt = createdAt;
        this.updateAt = updateAt;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public Timestamp getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Timestamp createdAt) {
        this.createdAt = createdAt;
    }

    public Timestamp getUpdateAt() {
        return updateAt;
    }

    public void setUpdateAt(Timestamp updateAt) {
        this.updateAt = updateAt;
    }

    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", gender='" + gender + '\'' +
                ", telephone='" + telephone + '\'' +
                ", email='" + email + '\'' +
                ", role='" + role + '\'' +
                ", createdAt=" + createdAt +
                ", updateAt=" + updateAt +
                '}';
    }
}
